Skip to content

only delete init if in cwd#5601

Merged
adhami3310 merged 1 commit into
mainfrom
only-delete-init-if-in-cwd
Jul 21, 2025
Merged

only delete init if in cwd#5601
adhami3310 merged 1 commit into
mainfrom
only-delete-init-if-in-cwd

Conversation

@adhami3310
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR improves the safety of Reflex's initialization process by making the deletion of __init__.py files more targeted. The change modifies the condition for deleting these files by adding a check to ensure the file is only deleted when it's in the current working directory.

The modification is important because:

  1. Previously, the code would delete any __init__.py file when it found a rxconfig.py file in the same directory
  2. This could potentially cause issues by deleting files from imported packages or modules outside the app's root directory
  3. The new check ensures only the __init__.py file in the app's root directory gets deleted, which is the intended behavior

Confidence score: 5/5

  1. This PR is very safe to merge as it adds a safety constraint to existing file deletion logic
  2. The score is 5 because this change can only reduce the scope of file deletions, making it strictly safer than the current behavior
  3. Key file to review: reflex/utils/exec.py (the change is straightforward and well-contained)

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jul 19, 2025

CodSpeed Performance Report

Merging #5601 will not alter performance

Comparing only-delete-init-if-in-cwd (6cad028) with main (9114d21)

Summary

✅ 8 untouched benchmarks

@adhami3310 adhami3310 merged commit 29fc5af into main Jul 21, 2025
52 of 53 checks passed
@adhami3310 adhami3310 deleted the only-delete-init-if-in-cwd branch July 21, 2025 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants